<template>
  <div>
    <div class="title">这是pageB</div>
    <div @click="goto('home')" class="btn">点击跳转home</div>

    <div style="margin-top: 100px">
      <div style="margin: 20px 0; font-size: 30px; color: blue">pinia的使用</div>
      <Birthday />
      <CountButton />
      <Getter />
    </div>
  </div>
</template>
<script setup>
// unplugin-vue-components 自动引入
// import Birthday from "@/components/Birthday.vue";
// import CountButton from "@/components/CountButton.vue";
// import Getter from "@/components/Getter.vue";

// unplugin-auto-import 自动引入
// import { onMounted, onUnmounted, ref, reactive, computed, getCurrentInstance, defineExpose } from "vue";
// import { useRouter, useRoute } from "vue-router";

const router = useRouter();
// 路由跳转
function goto(url) {
  router.push(url);
}

onMounted(() => {
  console.log("======>>>>pageB 加载了====");
});
onUnmounted(() => {
  console.log("======>>>>pageB 注销了====");
});
</script>
<style lang="less" scoped>
.title {
  margin-bottom: 10px;
}
</style>
